home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / bbs / l2100.zip / EXAMPLE.REF < prev    next >
Text File  |  1997-06-24  |  3KB  |  91 lines

  1. ; Afraid of using vars that LORD2 or other IGM's might change?  No prob!
  2. ; use your OWN vars!! The new @data commands make it easy and simple!
  3.  
  4. ; example of how to use the @data command set to easily create your own
  5. ; data file to check if a person had been in here that day already.
  6. ; by Seth A. Robinson, 6-24-97
  7.  
  8. ; ok, we'll call it 'the magic rock', it says something clever if a user
  9. ; pushes against it (it runs this file) but only ONCE per day.. if they
  10. ; they have already got their 'wisdom' for the day, it says go away.
  11.  
  12. ; this is a good example because this probably how most people will use
  13. ; the @data commands, just to see if someone has been here or not today.  But
  14. ; don't forget it is 200 longints that could be used in other ways too, for
  15. ; instance, a bank of your own, etc.
  16.  
  17. ; another note.. this .ref *IS* used in the game itself so don't delete it!!
  18. ; you could change it and see how it changes in the game though, the 'magic
  19. ; rock' is located in Greentree.
  20.  
  21. @#START
  22. @do moveback
  23. ; first we move them back, so they are not standing on the rock
  24.  
  25. @datanewday rock.idf
  26.  
  27. ; the above command will reset all #'s in ROCK.IDF to 0 *IF* a new day has
  28. ; occured since the last time this command was called.
  29.  
  30. ; use idf so it is easy for sysops to know which data files they can delete
  31. ; safely  (IGM DATA FILE)
  32.  
  33. @dataload rock.idf &playernum `p20
  34.  
  35. ; the above command is important - this is how you retrieve ALL data.
  36. ; &playernum is the current players # in the trader.dat file, and `p20 is
  37. ; a scratch var that we want to put the return result in.
  38.  
  39. @if `p20 not 1 then do
  40.   @begin
  41.  
  42.   ; woohoo, they have not been here yet today!
  43.   ; lets spew some wisdom.
  44.  
  45.   @do `p21 random 10 1
  46.   ; now `p21 is a random # between 1 and 10
  47.  
  48.   @if `p21 is 1 then saybar
  49. `0Magic Rock: `2Don't eat poison much.
  50.   @if `p21 is 2 then saybar
  51. `0Magic Rock: `2My sources say yes.
  52.   @if `p21 is 3 then saybar
  53. `0Magic Rock: `2Barak is guilty!  But you must prove it.
  54.   @if `p21 is 4 then saybar
  55. `0Magic Rock: `2You must learn to love yourself before you can love others.
  56.   @if `p21 is 5 then saybar
  57. `0Magic Rock: `2You must be very evil to be taken to Dragon Island...
  58.   @if `p21 is 6 then saybar
  59. `0Magic Rock: `2Making LORD2 IGM's is very easy.  Anyone can do it.
  60.   @if `p21 is 7 then saybar
  61. `0Magic Rock: `2There is a `%Moonstone`2 hidden in a waterfall.
  62.   @if `p21 is 8 then saybar
  63. `0Magic Rock: `2The Smackrod could help you break into Sosen Inn...
  64.   @if `p21 is 9 then saybar
  65. `0Magic Rock: `2Nice people have to pay more to get into Bonetown.
  66.   @if `p21 is 10 then saybar
  67. `0Magic Rock: `2If someone places a bounty on your head, your dead.
  68.  
  69.   @datasave rock.idf &playernum 1
  70.  
  71.   ; the above is IMPORTANT - we just set this persons data # to 1, now we
  72.   ; will know that he was here!  Until the next day, when it is reset to 0.
  73.  
  74.   ; all done let's do a @closescript so it will quit right now
  75.  
  76.   @closescript
  77.   @end
  78.  
  79. ; if we got here, it means they HAVE been on today.
  80.  
  81. @do saybar
  82. `2The strange rock refuses to speak again.
  83.  
  84. ; all done!
  85.  
  86. @#NOMORE
  87.  
  88. ; always put this at an end of a .ref file.. when it sees the @# it knows
  89. ; that the routine it was sent to do is over.  a @closescript works too.
  90.  
  91.